package com.apes.scm.masterdata.car.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：变速箱型号
 *
 * @Auther: linwz
 * @Date: 2018/7/24 11:11
 */
@Getter
@Setter
@Entity
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@EntityListeners(DefaultPersistListener.class)
@Table(name = GearBoxModel.CONST_TABLE_NAME)
public class GearBoxModel extends Model {

    public static final String CONST_TABLE_NAME = "mas_gear_box_model";

    @Id
    @Column(name = "id", length = 60)
    @Comment("编码")
    private String id;//变速箱型号编码

    @Column(name = "name",length = 60)
    @Comment("名称")
    private String name;//变速箱型号名称

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "gear_box_type_id",referencedColumnName = "id")
    @Comment("变速箱类型")
    private GearBoxType gearBoxType;//变速箱类型
}
